﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.PoseEditor.CUiKinPoseEditorForm
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.JointJog;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.PrivateImplementationDetails;
using Tecnomatix.Engineering.Ui;
using UiInternalControls;


namespace DnProcessSimulateCommands.PoseEditor;

public class CUiKinPoseEditorForm : TxForm
{
  private ITxDevice m_device;
  private TxPoseData m_initialPoseData;
  private const string HOME_POSE_NAME = "HOME";
  private int posesColumnIndex;
  private List<TxPose> m_posesList = new List<TxPose>();
  private CUiKinPoseEditorForm.eUiSpecificMode m_uiSpecificMode;
  private CUiKinJointJogForm m_jointJogDlg;
  private bool m_disabledUiMode;
  private int m_ignoreDeleteKeyEvent;
  private IContainer components;
  private TxListView m_posesListDataGridView;
  private Button m_buttonNew;
  private Button m_buttonEdit;
  private Button m_buttonDelete;
  private Button m_buttonJump;
  private Button m_buttonReset;
  private Button m_buttonClose;
  private Button m_buttonUpdate;
  private ToolTip m_toolTip;
  private Button m_buttonMove;
  private TxInfoButton txInfoButton1;
  private ColumnHeader columnHeader1;

  public CUiKinPoseEditorForm()
  {
    this.InitializeComponent();
    this.txInfoButton1.TooltipText = PoseEditorStringTable.INFO_TOOLTIP;
    ((Control) this).MinimumSize = ((Form) this).Size;
  }

  internal ITxDevice Device => this.m_device;

  public void Show(ITxDevice device)
  {
    ((Control) this).Text = ((Control) this).Text + ((ITxObject) device).Name;
    this.m_device = device;
    this.SetInViewMode();
    this.m_initialPoseData = new TxPoseData(this.m_device.CurrentPose);
    this.FillPosesList();
    this.RegisterEvents();
    ((Control) this).Show();
  }

  private void RegisterEvents()
  {
    ((ListView) this.m_posesListDataGridView).ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(this.M_posesListDataGridView_ItemSelectionChanged);
    ((ListView) this.m_posesListDataGridView).AfterLabelEdit += new LabelEditEventHandler(this.M_posesListDataGridView_AfterLabelEdit);
    ((ListView) this.m_posesListDataGridView).BeforeLabelEdit += new LabelEditEventHandler(this.M_posesListDataGridView_BeforeLabelEdit);
    this.m_device.PoseCreated += new TxDevice_PoseCreatedEventHandler(this.m_device_PoseCreated);
    this.m_device.DeviceCompiled += new TxDevice_DeviceCompiledEventHandler(this.m_device_DeviceCompiled);
    ((ITxObject) this.m_device).Deleted += new TxObject_DeletedEventHandler(this.m_device_Deleted);
    ((Form) this).FormClosed += new FormClosedEventHandler(this.CUiKinPoseEditorForm_FormClosed);
  }

  private void M_posesListDataGridView_BeforeLabelEdit(object sender, LabelEditEventArgs e)
  {
    if ((((ListView) this.m_posesListDataGridView).Items[e.Item].Tag as TxPose).CanBeRenamed)
      return;
    e.CancelEdit = true;
  }

  private void M_posesListDataGridView_AfterLabelEdit(object sender, LabelEditEventArgs e)
  {
    string label = e.Label;
    TxPose tag = ((ListView) this.m_posesListDataGridView).Items[e.Item].Tag as TxPose;
    if (!tag.CanBeRenamed)
    {
      e.CancelEdit = true;
    }
    else
    {
      if (!string.IsNullOrEmpty(label) && label != "HOME")
        tag.Name = label;
      else
        e.CancelEdit = true;
      if (tag.Name != label)
        ((ListView) this.m_posesListDataGridView).Items[e.Item].Text = tag.Name;
      else
        e.CancelEdit = true;
    }
  }

  private void M_posesListDataGridView_ItemSelectionChanged(
    object sender,
    ListViewItemSelectionChangedEventArgs e)
  {
    this.UpdateButtonStates();
  }

  private void UnregisterEvents()
  {
    ((ListView) this.m_posesListDataGridView).ItemSelectionChanged -= new ListViewItemSelectionChangedEventHandler(this.M_posesListDataGridView_ItemSelectionChanged);
    ((ListView) this.m_posesListDataGridView).AfterLabelEdit -= new LabelEditEventHandler(this.M_posesListDataGridView_AfterLabelEdit);
    ((ListView) this.m_posesListDataGridView).BeforeLabelEdit -= new LabelEditEventHandler(this.M_posesListDataGridView_BeforeLabelEdit);
    this.m_device.PoseCreated -= new TxDevice_PoseCreatedEventHandler(this.m_device_PoseCreated);
    this.m_device.DeviceCompiled -= new TxDevice_DeviceCompiledEventHandler(this.m_device_DeviceCompiled);
    ((ITxObject) this.m_device).Deleted -= new TxObject_DeletedEventHandler(this.m_device_Deleted);
    foreach (TxPose poses in this.m_posesList)
      this.UnregisterFromPoseEvents(poses);
  }

  private void SetInViewMode()
  {
    if (!this.IsAppearanceDevice)
      return;
    this.m_buttonEdit.Enabled = false;
    this.m_buttonDelete.Enabled = false;
    this.m_buttonNew.Enabled = false;
    this.m_buttonUpdate.Enabled = false;
  }

  private bool IsAppearanceDevice
  {
    get => this.m_device is TxPartAppearanceDevice || this.m_device is TxSkidAppearanceDevice;
  }

  private void FillPosesList()
  {
    foreach (TxPose pose in (Collection<ITxObject>) this.m_device.PoseList)
    {
      ListViewItem listViewItem = ((ListView) this.m_posesListDataGridView).Items.Add(pose.Name);
      ((ListView) this.m_posesListDataGridView).Items[listViewItem.Index].Tag = (object) pose;
      if (!pose.IsAtInstance)
        ((ListView) this.m_posesListDataGridView).Items[listViewItem.Index].Font = new Font(((Control) this.m_posesListDataGridView).Font, FontStyle.Bold);
      this.RegisterForPoseEvents(pose);
    }
    if (((ListView) this.m_posesListDataGridView).Items != null && ((ListView) this.m_posesListDataGridView).Items.Count > 0)
      ((ListView) this.m_posesListDataGridView).Items[0].Selected = true;
    this.UpdateButtonStates();
  }

  private void RegisterForPoseEvents(TxPose pose)
  {
    if (this.m_posesList.Contains(pose))
      return;
    this.m_posesList.Add(pose);
    pose.Deleted += new TxObject_DeletedEventHandler(this.pose_Deleted);
    pose.NameChanged += new TxObject_NameChangedEventHandler(this.pose_NameChanged);
  }

  private void UnregisterFromPoseEvents(TxPose pose)
  {
    pose.Deleted -= new TxObject_DeletedEventHandler(this.pose_Deleted);
    pose.NameChanged -= new TxObject_NameChangedEventHandler(this.pose_NameChanged);
  }

  private TxPose GetSelectedPose()
  {
    TxPose selectedPose = (TxPose) null;
    if (((ListView) this.m_posesListDataGridView).SelectedItems.Count == 1)
      selectedPose = (TxPose) ((ListView) this.m_posesListDataGridView).SelectedItems[0].Tag;
    return selectedPose;
  }

  private List<TxPose> GetSelectedPoses()
  {
    List<TxPose> selectedPoses = new List<TxPose>();
    if (((ListView) this.m_posesListDataGridView).SelectedItems.Count > 1)
    {
      for (int index = ((ListView) this.m_posesListDataGridView).SelectedItems.Count - 1; index >= 0; --index)
      {
        TxPose tag = ((ListView) this.m_posesListDataGridView).SelectedItems[index].Tag as TxPose;
        if (TxPose.op_Inequality(tag, (ITxObject) null))
          selectedPoses.Add(tag);
      }
    }
    return selectedPoses;
  }

  private void MoveToPose(TxPose pose)
  {
    this.EnterDisableUiMode();
    this.m_buttonClose.Enabled = false;
    CApKinPoseEditorUtils.MoveToPose(pose);
    this.ExitDisableUiMode();
    this.m_buttonClose.Enabled = true;
  }

  private bool CanDeletePose(TxPose pose)
  {
    bool flag = false;
    if (TxPose.op_Inequality(pose, (ITxObject) null) && pose.CanBeDeleted && TxMessageBox.Show(string.Format(PoseEditorStringTable.DELETE_WARNING, (object) pose.Name), PoseEditorStringTable.CMD_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      flag = true;
    return flag;
  }

  private bool CanDeletePoses(List<TxPose> poses)
  {
    bool flag = true;
    string str = "";
    foreach (TxPose pose in poses)
    {
      if (TxPose.op_Inequality(pose, (ITxObject) null))
      {
        flag = flag && pose.CanBeDeleted;
        str = $"{str} {pose.Name}";
      }
    }
    if (flag && TxMessageBox.Show(string.Format(PoseEditorStringTable.MULTI_DELETE_WARNING, (object) str), PoseEditorStringTable.CMD_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
      flag = false;
    return flag;
  }

  private void UpdateButtonStates()
  {
    if (this.m_disabledUiMode || ((ListView) this.m_posesListDataGridView).SelectedItems.Count == 0)
    {
      this.m_buttonDelete.Enabled = false;
      this.m_buttonEdit.Enabled = false;
      this.m_buttonUpdate.Enabled = false;
      this.m_buttonJump.Enabled = false;
      this.m_buttonMove.Enabled = false;
    }
    else if (((ListView) this.m_posesListDataGridView).SelectedItems.Count == 1)
    {
      TxPose selectedPose = this.GetSelectedPose();
      if (!TxPose.op_Inequality(selectedPose, (ITxObject) null))
        return;
      ITxComponent device = this.m_device as ITxComponent;
      if (this.m_device is TxSkidAppearanceDevice)
      {
        this.m_buttonEdit.Enabled = false;
        this.m_buttonDelete.Enabled = false;
        this.m_buttonUpdate.Enabled = false;
        this.m_buttonJump.Enabled = true;
        this.m_buttonMove.Enabled = false;
      }
      else
      {
        if (device == null)
          return;
        this.m_buttonEdit.Enabled = selectedPose.CanBeModified;
        this.m_buttonDelete.Enabled = selectedPose.CanBeDeleted;
        this.m_buttonUpdate.Enabled = selectedPose.CanBeModified;
        this.m_buttonJump.Enabled = true;
        this.m_buttonMove.Enabled = true;
      }
    }
    else
    {
      if (((ListView) this.m_posesListDataGridView).SelectedItems.Count <= 1)
        return;
      this.m_buttonEdit.Enabled = false;
      this.m_buttonUpdate.Enabled = false;
      this.m_buttonJump.Enabled = false;
      this.m_buttonMove.Enabled = false;
      if (this.m_device is TxSkidAppearanceDevice)
      {
        this.m_buttonDelete.Enabled = false;
      }
      else
      {
        List<TxPose> selectedPoses = this.GetSelectedPoses();
        if (selectedPoses == null || !(this.m_device is ITxComponent))
          return;
        bool flag = true;
        foreach (TxPose txPose in selectedPoses)
          flag = flag && txPose.CanBeDeleted;
        this.m_buttonDelete.Enabled = flag;
      }
    }
  }

  private void EnterDisableUiMode()
  {
    if (this.m_disabledUiMode)
      return;
    this.m_disabledUiMode = true;
    ((Control) this.m_posesListDataGridView).Enabled = false;
    this.m_buttonReset.Enabled = false;
    this.m_buttonNew.Enabled = false;
    this.UpdateButtonStates();
  }

  private void ExitDisableUiMode()
  {
    if (!this.m_disabledUiMode)
      return;
    this.m_disabledUiMode = false;
    ((Control) this.m_posesListDataGridView).Enabled = true;
    this.m_buttonReset.Enabled = true;
    this.m_buttonNew.Enabled = !this.IsAppearanceDevice;
    this.UpdateButtonStates();
  }

  private void m_buttonNew_Click(object sender, EventArgs e)
  {
    CUiKinJointJogForm cuiKinJointJogForm = CApKinPoseEditorUtils.OpenPoseJointJogForm(this.m_device, new Action<object, FormClosedEventArgs>(this.m_jointJogDlg_FormClosed));
    if (cuiKinJointJogForm == null)
      return;
    this.m_jointJogDlg = cuiKinJointJogForm;
    this.m_uiSpecificMode = CUiKinPoseEditorForm.eUiSpecificMode.MODE_NEW_POSE;
    this.EnterDisableUiMode();
  }

  private void m_buttonEdit_Click(object sender, EventArgs e)
  {
    CUiKinJointJogForm cuiKinJointJogForm = CApKinPoseEditorUtils.OpenPoseJointJogForm(this.m_device, new Action<object, FormClosedEventArgs>(this.m_jointJogDlg_FormClosed), this.GetSelectedPose());
    if (cuiKinJointJogForm == null)
      return;
    this.m_jointJogDlg = cuiKinJointJogForm;
    this.m_uiSpecificMode = CUiKinPoseEditorForm.eUiSpecificMode.MODE_EDIT_POSE;
    this.EnterDisableUiMode();
  }

  private void m_buttonUpdate_Click(object sender, EventArgs e)
  {
    TxPose selectedPose = this.GetSelectedPose();
    if (!TxPose.op_Inequality(selectedPose, (ITxObject) null))
      return;
    CApKinPoseEditorUtils.UpdatePose(selectedPose);
  }

  private void m_buttonDelete_Click(object sender, EventArgs e)
  {
    if (((ListView) this.m_posesListDataGridView).SelectedItems.Count > 1)
    {
      List<TxPose> selectedPoses = this.GetSelectedPoses();
      if (!this.CanDeletePoses(selectedPoses))
        return;
      TxApplication.ActiveUndoManager.StartTransaction();
      foreach (TxPose txPose in selectedPoses)
        txPose.Delete();
      TxApplication.ActiveUndoManager.EndTransaction();
    }
    else
    {
      if (((ListView) this.m_posesListDataGridView).SelectedItems.Count != 1)
        return;
      TxPose selectedPose = this.GetSelectedPose();
      if (!this.CanDeletePose(selectedPose))
        return;
      TxApplication.ActiveUndoManager.StartTransaction();
      selectedPose.Delete();
      TxApplication.ActiveUndoManager.EndTransaction();
    }
  }

  private void m_buttonReset_Click(object sender, EventArgs e)
  {
    this.m_device.CurrentPose = this.m_initialPoseData;
    TxApplication.RefreshDisplay();
  }

  private void m_buttonJump_Click(object sender, EventArgs e)
  {
    TxPose selectedPose = this.GetSelectedPose();
    if (!TxPose.op_Inequality(selectedPose, (ITxObject) null))
      return;
    CApKinPoseEditorUtils.JumpToPose(selectedPose);
  }

  private void m_buttonMove_Click(object sender, EventArgs e)
  {
    TxPose selectedPose = this.GetSelectedPose();
    if (!TxPose.op_Inequality(selectedPose, (ITxObject) null))
      return;
    this.MoveToPose(selectedPose);
  }

  private void m_buttonClose_Click(object sender, EventArgs e) => ((Form) this).Close();

  private void m_posesListDataGridView_SelectionChanged(object sender, EventArgs e)
  {
    this.UpdateButtonStates();
  }

  private void m_posesListDataGridView_DoubleClick(object sender, EventArgs e)
  {
    TxPose selectedPose = this.GetSelectedPose();
    if (!TxPose.op_Inequality(selectedPose, (ITxObject) null))
      return;
    CApKinPoseEditorUtils.JumpToPose(selectedPose);
  }

  private void m_posesListDataGridView_UserDeletingRow(
    object sender,
    DataGridViewRowCancelEventArgs e)
  {
    if (((ListView) this.m_posesListDataGridView).SelectedItems.Count == 1)
    {
      TxPose selectedPose = this.GetSelectedPose();
      if (this.CanDeletePose(selectedPose))
        selectedPose.Delete();
    }
    else if (((ListView) this.m_posesListDataGridView).SelectedItems.Count > 1)
    {
      if (this.m_ignoreDeleteKeyEvent == 0)
      {
        List<TxPose> selectedPoses = this.GetSelectedPoses();
        if (this.CanDeletePoses(selectedPoses))
        {
          TxApplication.ActiveUndoManager.StartTransaction();
          foreach (TxPose txPose in selectedPoses)
            txPose.Delete();
          TxApplication.ActiveUndoManager.EndTransaction();
        }
        else
          this.m_ignoreDeleteKeyEvent = ((ListView) this.m_posesListDataGridView).SelectedItems.Count - 1;
      }
      else
        --this.m_ignoreDeleteKeyEvent;
    }
    e.Cancel = true;
  }

  private void m_device_PoseCreated(object sender, TxDevice_PoseCreatedEventArgs args)
  {
    TxPose pose = args.Pose;
    ListViewItem listViewItem = ((ListView) this.m_posesListDataGridView).Items.Add(pose.Name);
    ((ListView) this.m_posesListDataGridView).Items[listViewItem.Index].Tag = (object) pose;
    if (!pose.IsAtInstance)
      ((ListView) this.m_posesListDataGridView).Items[listViewItem.Index].Font = new Font(((Control) this.m_posesListDataGridView).Font, FontStyle.Bold);
    this.RegisterForPoseEvents(pose);
    this.UpdateButtonStates();
  }

  private void pose_NameChanged(object sender, TxObject_NameChangedEventArgs args)
  {
    TxPose txPose = sender as TxPose;
    if (!TxPose.op_Inequality(txPose, (ITxObject) null))
      return;
    foreach (ListViewItem listViewItem in ((ListView) this.m_posesListDataGridView).Items)
    {
      TxPose tag = listViewItem.Tag as TxPose;
      if (TxPose.op_Inequality(tag, (ITxObject) null) && TxPose.op_Equality(tag, (ITxObject) txPose))
      {
        listViewItem.Text = tag.Name;
        break;
      }
    }
    this.UpdateButtonStates();
  }

  private void pose_Deleted(object sender, TxObject_DeletedEventArgs args)
  {
    ListViewItem listViewItem1 = (ListViewItem) null;
    TxPose pose = sender as TxPose;
    if (!TxPose.op_Inequality(pose, (ITxObject) null))
      return;
    foreach (ListViewItem listViewItem2 in ((ListView) this.m_posesListDataGridView).Items)
    {
      TxPose tag = listViewItem2.Tag as TxPose;
      if (TxPose.op_Inequality(tag, (ITxObject) null) && TxPose.op_Equality(tag, (ITxObject) pose))
      {
        listViewItem1 = listViewItem2;
        break;
      }
    }
    if (listViewItem1 != null)
    {
      this.m_posesList.Remove(pose);
      this.UnregisterFromPoseEvents(pose);
      ((ListView) this.m_posesListDataGridView).Items.Remove(listViewItem1);
    }
    this.UpdateButtonStates();
  }

  private void CUiKinPoseEditorForm_FormClosed(object sender, FormClosedEventArgs e)
  {
    this.UnregisterEvents();
    if (this.m_jointJogDlg == null)
      return;
    try
    {
      ((Form) this.m_jointJogDlg).FormClosed -= new FormClosedEventHandler(this.m_jointJogDlg_FormClosed);
      ((Form) this.m_jointJogDlg).Close();
    }
    finally
    {
      this.m_jointJogDlg = (CUiKinJointJogForm) null;
    }
  }

  private void m_device_DeviceCompiled(object sender, TxDevice_DeviceCompiledEventArgs args)
  {
    int num = (int) TxMessageBox.Show(PoseEditorStringTable.MSG_POSE_EDITOR_CLOSE_ON_KINEMATIC_MODIFIED, ((Control) this).Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    ((Form) this).Close();
  }

  private void m_jointJogDlg_FormClosed(object sender, FormClosedEventArgs e)
  {
    if (this.m_jointJogDlg == null)
      return;
    ((Form) this.m_jointJogDlg).FormClosed -= new FormClosedEventHandler(this.m_jointJogDlg_FormClosed);
    switch (this.m_uiSpecificMode)
    {
      case CUiKinPoseEditorForm.eUiSpecificMode.MODE_NEW_POSE:
        if (this.m_jointJogDlg.CloseDialogResult == DialogResult.OK)
        {
          TxPose newPose = CApKinPoseEditorUtils.CreateNewPose(this.m_device, this.m_jointJogDlg.PoseName);
          if (TxPose.op_Inequality(newPose, (ITxObject) null))
          {
            this.selectGridSingleRow(this.getGridPoseRow(newPose), true);
            break;
          }
          break;
        }
        break;
      case CUiKinPoseEditorForm.eUiSpecificMode.MODE_EDIT_POSE:
        if (this.m_jointJogDlg.CloseDialogResult == DialogResult.OK)
        {
          TxPose selectedPose = this.GetSelectedPose();
          if (TxPose.op_Inequality(selectedPose, (ITxObject) null))
          {
            selectedPose.PoseData = this.m_device.CurrentPose;
            if (!this.m_jointJogDlg.PoseNameReadOnly)
            {
              selectedPose.Name = this.m_jointJogDlg.PoseName;
              break;
            }
            break;
          }
          break;
        }
        break;
    }
    this.m_jointJogDlg = (CUiKinJointJogForm) null;
    this.m_uiSpecificMode = CUiKinPoseEditorForm.eUiSpecificMode.MODE_NONE;
    this.ExitDisableUiMode();
    ((Control) this.m_posesListDataGridView).Focus();
  }

  private void m_device_Deleted(object sender, TxObject_DeletedEventArgs args)
  {
    ((Form) this).Close();
  }

  private void CUiKinPoseEditorForm_FormClosing(object sender, FormClosingEventArgs e)
  {
    if (this.m_buttonClose.Enabled)
      return;
    e.Cancel = true;
  }

  private int getGridPoseRow(TxPose pose)
  {
    int gridPoseRow = -1;
    if (TxPose.op_Inequality(pose, (ITxObject) null))
    {
      foreach (ListViewItem listViewItem in ((ListView) this.m_posesListDataGridView).Items)
      {
        TxPose tag = listViewItem.Tag as TxPose;
        if (TxPose.op_Inequality(tag, (ITxObject) null) && TxPose.op_Equality(tag, (ITxObject) pose))
        {
          gridPoseRow = listViewItem.Index;
          break;
        }
      }
    }
    return gridPoseRow;
  }

  private bool selectGridSingleRow(int rowIndex, bool ensureVisible)
  {
    bool flag = false;
    if (rowIndex >= 0 && rowIndex < ((ListView) this.m_posesListDataGridView).Items.Count)
    {
      ((Control) this.m_posesListDataGridView).SuspendLayout();
      ((ListView) this.m_posesListDataGridView).SelectedIndices.Clear();
      bool enabled = ((Control) this.m_posesListDataGridView).Enabled;
      ((Control) this.m_posesListDataGridView).Enabled = true;
      ((ListView) this.m_posesListDataGridView).Items[rowIndex].Selected = true;
      if (ensureVisible)
        ((ListView) this.m_posesListDataGridView).EnsureVisible(rowIndex);
      ((Control) this.m_posesListDataGridView).Enabled = enabled;
      ((Control) this.m_posesListDataGridView).ResumeLayout();
      flag = true;
    }
    return flag;
  }

  private void CUiKinPoseEditorForm_Load(object sender, EventArgs e)
  {
    ((ListView) this.m_posesListDataGridView).Columns[0].Width = ((Control) this.m_posesListDataGridView).Width;
  }

  private void m_posesListDataGridView_ClientSizeChanged(object sender, EventArgs e)
  {
    ((Control) this.m_posesListDataGridView).SuspendLayout();
    ((ListView) this.m_posesListDataGridView).Columns[0].Width = ((Control) this.m_posesListDataGridView).Width;
    ((Control) this.m_posesListDataGridView).ResumeLayout();
  }

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    this.components = (IContainer) new Container();
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CUiKinPoseEditorForm));
    this.m_posesListDataGridView = new TxListView();
    this.columnHeader1 = new ColumnHeader();
    this.m_buttonNew = new Button();
    this.m_buttonEdit = new Button();
    this.m_buttonDelete = new Button();
    this.m_buttonJump = new Button();
    this.m_buttonReset = new Button();
    this.m_buttonClose = new Button();
    this.m_buttonUpdate = new Button();
    this.m_toolTip = new ToolTip(this.components);
    this.m_buttonMove = new Button();
    this.txInfoButton1 = new TxInfoButton();
    ((Control) this).SuspendLayout();
    componentResourceManager.ApplyResources((object) this.m_posesListDataGridView, "m_posesListDataGridView");
    ((ListView) this.m_posesListDataGridView).Columns.AddRange(new ColumnHeader[1]
    {
      this.columnHeader1
    });
    ((ListView) this.m_posesListDataGridView).FullRowSelect = true;
    ((ListView) this.m_posesListDataGridView).GridLines = true;
    ((ListView) this.m_posesListDataGridView).HeaderStyle = ColumnHeaderStyle.Nonclickable;
    ((ListView) this.m_posesListDataGridView).HideSelection = false;
    ((ListView) this.m_posesListDataGridView).LabelEdit = true;
    ((Control) this.m_posesListDataGridView).Name = "m_posesListDataGridView";
    ((ListView) this.m_posesListDataGridView).UseCompatibleStateImageBehavior = false;
    ((ListView) this.m_posesListDataGridView).View = View.Details;
    ((Control) this.m_posesListDataGridView).ClientSizeChanged += new EventHandler(this.m_posesListDataGridView_ClientSizeChanged);
    ((Control) this.m_posesListDataGridView).DoubleClick += new EventHandler(this.m_posesListDataGridView_DoubleClick);
    componentResourceManager.ApplyResources((object) this.columnHeader1, "columnHeader1");
    componentResourceManager.ApplyResources((object) this.m_buttonNew, "m_buttonNew");
    this.m_buttonNew.Name = "m_buttonNew";
    this.m_toolTip.SetToolTip((Control) this.m_buttonNew, componentResourceManager.GetString("m_buttonNew.ToolTip"));
    this.m_buttonNew.UseVisualStyleBackColor = true;
    this.m_buttonNew.Click += new EventHandler(this.m_buttonNew_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonEdit, "m_buttonEdit");
    this.m_buttonEdit.Name = "m_buttonEdit";
    this.m_toolTip.SetToolTip((Control) this.m_buttonEdit, componentResourceManager.GetString("m_buttonEdit.ToolTip"));
    this.m_buttonEdit.UseVisualStyleBackColor = true;
    this.m_buttonEdit.Click += new EventHandler(this.m_buttonEdit_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonDelete, "m_buttonDelete");
    this.m_buttonDelete.Name = "m_buttonDelete";
    this.m_toolTip.SetToolTip((Control) this.m_buttonDelete, componentResourceManager.GetString("m_buttonDelete.ToolTip"));
    this.m_buttonDelete.UseVisualStyleBackColor = true;
    this.m_buttonDelete.Click += new EventHandler(this.m_buttonDelete_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonJump, "m_buttonJump");
    this.m_buttonJump.Name = "m_buttonJump";
    this.m_toolTip.SetToolTip((Control) this.m_buttonJump, componentResourceManager.GetString("m_buttonJump.ToolTip"));
    this.m_buttonJump.UseVisualStyleBackColor = true;
    this.m_buttonJump.Click += new EventHandler(this.m_buttonJump_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonReset, "m_buttonReset");
    this.m_buttonReset.Name = "m_buttonReset";
    this.m_toolTip.SetToolTip((Control) this.m_buttonReset, componentResourceManager.GetString("m_buttonReset.ToolTip"));
    this.m_buttonReset.UseVisualStyleBackColor = true;
    this.m_buttonReset.Click += new EventHandler(this.m_buttonReset_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonClose, "m_buttonClose");
    this.m_buttonClose.Name = "m_buttonClose";
    this.m_buttonClose.UseVisualStyleBackColor = true;
    this.m_buttonClose.Click += new EventHandler(this.m_buttonClose_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonUpdate, "m_buttonUpdate");
    this.m_buttonUpdate.Name = "m_buttonUpdate";
    this.m_toolTip.SetToolTip((Control) this.m_buttonUpdate, componentResourceManager.GetString("m_buttonUpdate.ToolTip"));
    this.m_buttonUpdate.UseVisualStyleBackColor = true;
    this.m_buttonUpdate.Click += new EventHandler(this.m_buttonUpdate_Click);
    componentResourceManager.ApplyResources((object) this.m_buttonMove, "m_buttonMove");
    this.m_buttonMove.Name = "m_buttonMove";
    this.m_toolTip.SetToolTip((Control) this.m_buttonMove, componentResourceManager.GetString("m_buttonMove.ToolTip"));
    this.m_buttonMove.UseVisualStyleBackColor = true;
    this.m_buttonMove.Click += new EventHandler(this.m_buttonMove_Click);
    componentResourceManager.ApplyResources((object) this.txInfoButton1, "txInfoButton1");
    ((Control) this.txInfoButton1).Name = "txInfoButton1";
    this.txInfoButton1.TabStop = true;
    this.txInfoButton1.TooltipDuration = 5000;
    this.txInfoButton1.TooltipText = (string) null;
    this.txInfoButton1.TooltipTitle = "";
    this.txInfoButton1.Type = (TxInfoButton.InfoType) 0;
    componentResourceManager.ApplyResources((object) this, "$this");
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Control) this).Controls.Add((Control) this.txInfoButton1);
    ((Control) this).Controls.Add((Control) this.m_buttonMove);
    ((Control) this).Controls.Add((Control) this.m_buttonUpdate);
    ((Control) this).Controls.Add((Control) this.m_buttonClose);
    ((Control) this).Controls.Add((Control) this.m_buttonReset);
    ((Control) this).Controls.Add((Control) this.m_buttonJump);
    ((Control) this).Controls.Add((Control) this.m_buttonDelete);
    ((Control) this).Controls.Add((Control) this.m_buttonEdit);
    ((Control) this).Controls.Add((Control) this.m_buttonNew);
    ((Control) this).Controls.Add((Control) this.m_posesListDataGridView);
    ((Form) this).MaximizeBox = false;
    ((Form) this).MinimizeBox = false;
    ((Control) this).Name = nameof (CUiKinPoseEditorForm);
    this.SemiModal = false;
    this.ShouldCloseOnDocumentUnloading = true;
    ((Form) this).Load += new EventHandler(this.CUiKinPoseEditorForm_Load);
    ((Control) this).ResumeLayout(false);
  }

  private enum eUiSpecificMode
  {
    MODE_NONE,
    MODE_NEW_POSE,
    MODE_EDIT_POSE,
  }
}
